# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Federico Cinelli <cinelli@aur.archlinux.org>

pkgname=texmaker
pkgver=5.1.4
pkgrel=1
pkgdesc='Free cross-platform LaTeX editor'
arch=(loong64 x86_64)
url='https://www.xm1math.net/texmaker/index.html'
license=(GPL)
depends=(qt6-declarative qt6-5compat texlive-core)
optdepends=('ghostscript: LaTeX to HTML conversion command')
source=(https://www.xm1math.net/$pkgname/$pkgname-$pkgver.tar.bz2)
sha256sums=('320504d62b71b591c06b7d0b1202ac750a3112fe2ca328e30580055eb308fea6')

build() {
  cd $pkgname-$pkgver
  qmake6 PREFIX=/usr texmaker.pro
  make
}
package() {
  cd $pkgname-$pkgver

  install -dm755 "$pkgdir"/usr/share
  make INSTALL_PATH="$pkgdir" INSTALL_ROOT="$pkgdir" PREFIX="/usr" install
}
